package com.tuniu.agents.common.agent;

import com.tuniu.agents.agent.AgentFactory;
import com.tuniu.agents.agent.AgentManagerGroup;
import com.tuniu.agents.agent.BaseAgent;
import com.tuniu.agents.common.command.CommandManager;
import lombok.SneakyThrows;
import org.springframework.ai.chat.prompt.ChatOptions;
import org.springframework.ai.openai.OpenAiChatOptions;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AgentConfig {

    public static final String OTHER_AGENT_ID = "GeneralAgent";

    @Bean(OTHER_AGENT_ID)
    @SneakyThrows
    public BaseAgent generalTicketAgent(AgentFactory agentFactory) {
        return agentFactory.createBaseAgent(OTHER_AGENT_ID,"general-agent");
    }

    @Bean(CommandAgent.AGENT_ID)
    public CommandAgent commandAgent(CommandManager commandManager, AgentManagerGroup agentManagerGroup) {
        return new CommandAgent(commandManager, agentManagerGroup);
    }

    @Bean("qwen-14b")
    public ChatOptions newChatOptions() {
        return OpenAiChatOptions.builder()
                .model("qwen2.5-14b-instruct")
                .temperature(0.3d)
                .build();
    }
    @Bean("qwen-vl-max-latest")
    public ChatOptions newChatOptionsVL() {
        return OpenAiChatOptions.builder()
                .model("qwen-vl-max-latest")
                .temperature(0.3d)
                .build();
    }

    @Bean("gpt-4o")
    public ChatOptions newChatOptionsGPT() {
        return OpenAiChatOptions.builder()
                .model("gpt-4o")
                .temperature(0.3d)
                .build();
    }

    @Bean("DEEPSEEK_R1_DISTILL")
    public ChatOptions newChatOptionsDSR1D() {
        return OpenAiChatOptions.builder()
                .model("deepseek-r1—distill-qwen-32b")
                .temperature(0.3d)
                .build();
    }
    @Bean("DEEPSEEK_R1")
    public ChatOptions newChatOptionsDSR1() {
        return OpenAiChatOptions.builder()
                .model("deepseek-r1")
                .temperature(0.3d)
                .build();
    }
    @Bean("qwen-32b")
    public ChatOptions newChatOptionsQw32B() {
        return OpenAiChatOptions.builder()
                .model("qwen2.5-32b-instruct")
                .temperature(0.3d)
                .build();
    }

}
